import request from '@/utils/request'

// 获取精选列表
export const getChoiceList = (params) =>
  request({
    url: '/questions/choice',
    method: 'GET',
    params
  })

// id获取题目信息
export const getChoiceIdData = (id) =>
  request({
    url: '/questions/' + id,
    method: 'GET'
  })
// id 审核信息

export const getCheckInfo = (data) =>
  request({
    url: '/questions/check/' + data.id,
    method: 'POST',
    data
  })
// 上下架
export const sellTitle = (data) =>
  request({
    url: '/questions/choice/' + data.id + '/' + data.publishState,
    method: 'POST',
    data
  })
// 学科列表  subjects/simple
export const getSimpleInfo = () =>
  request({
    url: '/subjects/simple/',
    method: 'GET'
  })
// 获取二级目录
export const getSecondLevelDirectory = (params) =>
  request({
    url: '/directorys/simple/',
    method: 'GET',
    params
  })
// 获取标签
export const getTag = (params) =>
  request({
    url: '/tags/simple/',
    method: 'GET',
    params
  })
// http://122.51.249.55:7001/questions/20

export const deltitle = (id) =>
  request({
    url: '/questions/' + id,
    method: 'DELETE'
  })
